Type-checking Linear Dependent Types

نویسندگان

  • Arthur Azevedo de Amorim
  • Emilio Jesús Gallego Arias
  • Marco Gaboardi
  • Justin Hsu
چکیده

Linear indexed type systems have been used to ensure safety properties of programs with respect to dierent kinds of resources; examples include usage analysis [10], implicit complexity [3], and more. Linear indexed types use a type-level index language to describe resources and linear types to reason about the program's resource usage in a compositional way. A limitation of current analysis techniques for such systems is that resource usage is inferred independently of the control ow of a programe.g., the typing rule for branching usually approximates resources by taking the maximal usage of one of the branches. To make this analysis more precise, some authors have proposed extending adding dependent types, considering both resource usage and the size information of a program's input. This signicantly enriches the resulting analysis by allowing resource usage to depend on runtime information. Linear dependent type systems have been used in several domains, such as implicit complexity [1] and others. Of course, there is a price to be paid for the increase in expressiveness: type checking and type inference inevitably become more complex. In linear indexed type systems, these tasks are often done in two stages: a standard Hindley-Milner-like pass, followed by a constraint-solving procedure. In some cases, the generated constraints can be solved automatically with custom algorithms [6] or o-the-shelf SMT solvers [4]. However, the constraints are specic to the index language, and richer index languages often lead to more complex constraints. In this work we consider the type-checking problem for a particular system with linear dependent types, DFuzz. DFuzz was born out of Fuzz [9], a language where types are used to reason about sensitivity of programs, which measures the distance between outputs on nearby inputs. Fuzz uses real numbers as indices for the linear types, which provide an upper bound on the sensitivity of the program. As shown by [4], type-checking Fuzz programs can be done eciently by using an SMT solver to discharge the numeric proof obligations arising from the type system. The same approach works for type inference, which infers the minimal sensitivity of a function. DFuzz [5] was introduced to overcome a fundamental limitation of Fuzz: sensitivity information cannot depend on runtime information, such as the size of a data structure. This is done by enriching Fuzz with a limited form of dependent types, whose index language combines information about the size of data structures and the sensitivity of functions. …

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Checking Dependent Types Using Compiled Code Preliminary Report

Type checkers for dependent types need to evaluate user defined functions during type checking. For this, current implementations typically use an interpreter, which has drawbacks. We show, how at this stage compiled code can be used for a language with lazy evaluation.

متن کامل

Development of a termination checker for Dedukti

Dedukti [12] is a formal proof checker based on a logical framework called the λΠ-calculus modulo, which is an extension of the simply-typed lambdacalculus with dependent types (e.g. lists of size n) and an equivalence relation on types generated by user-defined rewrite rules (like in Agda or Haskell). Proofs generated by some automated theorem provers (e.g. Zenon, iProver) or proof assistants ...

متن کامل

Dependent Types for Multi-Rate Flows in Synchronous Programming (System Description)

Synchronous programming languages emerged in the 1980s as tools for implementing reactive systems, which interact with events from physical environments and often must do so under strict timing constraints. In this report, we encode inside ATS various real-time primitives in an experimental synchronous language called Prelude, where ATS is a statically typed language with an ML-like functional ...

متن کامل

Dagstuhl Seminar 17051 Theory and Applications of Behavioural Types

This report documents the programme and the outcomes of Dagstuhl Seminar 17051 “Theory and Applications of Behavioural Types”. Behavioural types describe the dynamic aspects of programs, in contrast to data types, which describe the fixed structure of data. Perhaps the most well-known form of behavioural types is session types, which are type-theoretic specifications of communication protocols....

متن کامل

Executable Refinement Types

Executable Refinement Types by Kenneth L. Knowles Precise specifications are integral to effective programming practice. Existing specification disciplines such as structural type systems, dynamic contracts, and extended static checking all suffer from limitations such as imprecision, false positives, false negatives, or excessive manual proof burden. New ways of expressing and enforcing progra...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2014